<?php
namespace app\common\model;

use think\Model;

class UsedTruck extends Model
{
	protected $insert = ['create_time'];

	protected function setCreateTimeAttr()
	{
		return date('Y-m-d H:i:s');
	}
	/**
	 * 序列化photo图集
	 * @param $value
	 * @return string
	 */
	protected function setPhotoAttr($value)
	{
	    return serialize($value);
	}

	/**
	 * 反序列化photo图集
	 * @param $value
	 * @return mixed
	 */
	protected function getPhotoAttr($value)
	{
	    return unserialize($value);
	}

	protected function setSiteAttr($value)
	{
		$value = implode(',',$value);
	    return $value;
	}

	protected function getSiteAttr($value)
	{
		$value = explode(',',$value);
	    return $value;
	}

}